<template>
  <v-touch v-on:swiperight="onSwipeRight" :swipe-options="{direction: 'horizontal'}">
    <div style="height: 100%;overflow:hidden">
        <div style="padding-bottom:20px">
        <x-header :left-options="{backText:''}" @on-click-back="$router.go(-1)">用户反馈</x-header>
        <group class="part1">
            <x-input title="标题" v-model="title" text-align="right"></x-input>
            <popup-picker title="反馈模块" placeholder="请选择" :data="modules" v-model="backModule"></popup-picker>
            <popup-picker title="问题类别" placeholder="请选择" :data="type" v-model="chooseType"></popup-picker>
        </group>
         <div class="sup"></div>
         <group title="反馈内容及建议">
              <x-textarea  v-model="content" :max="2000"></x-textarea>
         </group>
          <div class="sup"></div>
        <div style="position:relative;left:20px">图片</div>
        <div style="margin-top:10px"><picture-upload :pageToken="pageToken" v-model="fieldToken"></picture-upload></div>
         <div class="sup"></div>
        <group>
            <x-input title="填写人" v-model="name" disabled text-align="right"></x-input>
            <x-input title="联系电话" v-model="phone" disabled text-align="right"></x-input>
            <x-input title="所在部门" v-model="dept" disabled text-align="right"></x-input>
            <x-input title="反馈日期" v-model="inputDate" disabled text-align="right"></x-input>
            
            <!-- <person-tree title="处理人员" v-model="person"></person-tree> -->
        </group>
        <div class="sup"></div>
        <group>
            <person-tree    
                title="实际反馈人" 
                v-model="FEEDBACKFULLNAME"
                :personid="FEEDBACKNAME"
                :defaultValue="FEEDBACKNAME"
                @selectUser='selectFeedBackUser'></person-tree>
            <person-tree    
                title="现场负责人" 
                v-model="PRINCIPALFULLNAME"
                :personid="PRINCIPALNAME"
                :defaultValue="PRINCIPALNAME"
                @selectUser='selectPrincipalName'></person-tree>
             <cell title="是否停工"
                  v-model="ISSIGN"
                  text-align=right></cell>
            <x-input title="开发负责人" v-model="person" disabled text-align="right"></x-input>
        </group>
        <div style="text-align:center;display:flex" class="top-border">
            <button class="userBack-button_save" @click="save">暂存</button>
            <button class="userBack-button_submit" @click="submit">提交</button>
             <Toast :value="toastValue" :is-show-mask="true" text="保存成功"></Toast>
            <Toast :value="toastValueErr" :is-show-mask="true" :text="error" @on-hide="saveErr" type="cancel" width="200px"></Toast>
        </div>
        <router-view style="height:100%;"></router-view>
        </div>
    </div>
    </v-touch>
</template>

<script>
import {Cell,Group,XInput,XTextarea,PopupPicker,Toast} from 'vux'
export default {
    name: 'startUserBack',
    components:{
        Cell,
        Group,
        XInput,
        XTextarea,
        PopupPicker,
        Toast
    },
    data(){
        return {
            title:"",
            content:"",
            advice:"",
            pageToken: "",
            fieldToken: "",
            temp:[],
            modules:[],
            backModule :[],
            //['页面错误、乱码等问题反馈','页面交互美观优化建议','使用问题','功能点增加','其他']
            type:[],
            chooseType : [],
            person:"系统开发管理员",//开发负责人
            personName:"admin2",
            name:this.$store.state.user.ADUSER_NAME,
            phone:this.$store.state.user.mobil,
            dept:this.$store.state.user.orgName,
            inputDate:this.$store.state.user.loginTime.substring(0,10),
            error:"",
            toastValueErr:false,
            toastValue:false,
            FEEDBACKFULLNAME:this.$store.state.user.ADUSER_NAME,//实际反馈人
            FEEDBACKNAME:this.$store.state.user.loginId,//实际反馈人用户名
            PRINCIPALFULLNAME:"系统维护账户",//现场负责人
            PRINCIPALNAME:"admin1",//现场负责人用户名
            ISSIGN:"否",//是否会签
        }
    },
    mounted(){
        //this.getTag();
        this.pageToken = this.guid();
        // this.fieldToken = this.guid();
        this.getBackModulesAndType();//获取反馈模块和问题类别
        // window.cordova.plugins.Keyboard.disableScroll(true);
        cordova.plugins.Keyboard.close();
    },
    methods:{
        // clearData(){
        //     debugger
        //     this.title = "";
        // },
        selectPrincipalName(val){
            this.PRINCIPALNAME = val;
            console.log(this.PRINCIPALNAME);
        },
        selectFeedBackUser(val){
            this.FEEDBACKNAME = val;
            console.log(this.FEEDBACKNAME);
        },
        getTag(){
            let input = document.getElementsByTagName('input');
            input.onblur=function(){
                //console.log('失去焦点')
                window.scrollTo(0,0);
            }
            let textarea = document.getElementsByTagName('textarea');
            textarea.onblur=function(){
                //console.log('失去焦点')
                window.scrollTo(0,0);
            }
            // console.log("inininninin",input);
            // console.log("tetetetete",textarea);
        },
        onSwipeRight(){
            this.$router.go(-1)
        },
        submit(){
            this.error = ""
            console.log("backModule",this.backModule[0]);
            console.log("chooseType",this.chooseType[0]);
            if(this.title==""){
                this.error += "标题不能为空<br/>"
            }
            if(this.backModule[0]==undefined){
                this.error += "反馈模块不能为空<br/>"
            }
            if(this.chooseType[0]==undefined){
                this.error += "问题类别不能为空<br/>"
            }
            if(this.content==""){
                this.error += "反馈内容不能为空<br/>"
            }
            if(this.error!=""){
                this.toastValueErr = true
                return false;
            }
            // var params = '{"_method":"formService.saveFormData",'+
            // '"requestEventData":{"eventType":"formSubmitEvent","formType":1,"bizObjId":"PMBASE_USERBACK2","'+
            // 'formId":"PMBASE_USERBACK2_add","buttonId":"HandleCommand_1"},"flowParam":{"defKey":"PMBASE_USERBACK2",'+
            // '"nodeId":"UserTask_1","userCommandType":"startandsubmit","userCommandId":"HandleCommand_1","isAdmin":"false","taskComment":""'+
            // '"extParam":{}},"_OBJ_NAME_":"PMBASE_USERBACK2","_FORM_ID_":"PMBASE_USERBACK2_add","useType":"add","pageToken":'+
            // '"'+this.pageToken+'","formData":{"objName":"PMBASE_USERBACK2","pks":["GUID"],"data":[{"rowData":'+
            // '[{"DataTarget":"GUID","Value":"","OriginalValue":null,"PK":true,"DataType":"String"},{"DataTarget":"STATE","Value":"",'+
            // '"OriginalValue":null,"PK":false,"DataType":"String"},'+
            // '{"DataTarget":"BACKTITLE","Value":"'+this.title+'","OriginalValue":null,"PK":false,"DataType":"String"},'+
            // '{"DataTarget":"BACKMODULE","Value":"'+this.backModule[0]+'","OriginalValue":null,"PK":false,"DataType":"String"},'+
            // '{"DataTarget":"IMPORTANT","Value":"'+this.chooseType[0]+'","OriginalValue":null,"PK":false,"DataType":"String"},'+
            // '{"DataTarget":"BACKCONT","Value":"'+this.content+'","OriginalValue":null,"PK":false,"DataType":"String"},'+
            // '{"DataTarget":"PICTURE","Value":"'+this.fieldToken+'","OriginalValue":null,"PK":false,"DataType":"Store.ecidiDoc"},'+
            // '{"DataTarget":"IDEA","Value":"'+this.advice+'","OriginalValue":null,"PK":false,"DataType":"String"},'+
            // '{"DataTarget":"INPUTUSERNAME","Value":"'+this.name+'","OriginalValue":null,"PK":false,"DataType":"String"},'+
            // '{"DataTarget":"PHONENUM","Value":"'+this.phone+'","OriginalValue":null,"PK":false,"DataType":"String"},'+
            // '{"DataTarget":"DEPTNAME","Value":"'+this.dept+'","OriginalValue":null,"PK":false,"DataType":"String"},'+
            // '{"DataTarget":"NOTIFYCHECK","Value":"SMS","OriginalValue":null,"PK":false,"DataType":"String"},'+
            // '{"DataTarget":"NOTIFYMETHOD","Value":"0,1,0","OriginalValue":null,"PK":false,"DataType":"String"},'+ 
            // '{"DataTarget":"INPUTDATE","Value":" '+this.inputDate+'","OriginalValue":null,"PK":false,"DataType":"TimeStamp"},'+
            // '{"DataTarget":"HANDLERFULLNAME","Value":"'+this.person+'","OriginalValue":null,"PK":false,"DataType":"String"},'+
            // '{"DataTarget":"HANDLERNAME","Value":"'+this.personName+'","OriginalValue":null,"PK":false,"DataType":"String"},'+
            // '{"DataTarget":"FEEDBACKFULLNAME","Value":"'+this.FEEDBACKFULLNAME+'","OriginalValue":null,"PK":false,"DataType":"String"},'+
            // '{"DataTarget":"FEEDBACKNAME","Value":"'+this.FEEDBACKNAME+'","OriginalValue":null,"PK":false,"DataType":"String"},'+
            // '{"DataTarget":"PRINCIPALFULLNAME","Value":"'+this.PRINCIPALFULLNAME+'","OriginalValue":null,"PK":false,"DataType":"String"},'+
            // '{"DataTarget":"PRINCIPALNAME","Value":"'+this.PRINCIPALNAME+'","OriginalValue":null,"PK":false,"DataType":"String"},'+
            // '{"DataTarget":"ISSIGN","Value":"'+this.ISSIGN+'","OriginalValue":null,"PK":false,"DataType":"String"},'+
            // '{"DataTarget":"SIGNFULLNAME","Value":"","OriginalValue":null,"PK":false,"DataType":"String"},'+
            // '{"DataTarget":"SIGNNAME","Value":"","OriginalValue":null,"PK":false,"DataType":"String"},'+
            // '{"DataTarget":"ENDDATE","Value":"","OriginalValue":null,"PK":false,"DataType":"TimeStamp"}],'+
            // '"children":[]}]},"_ATTACHMENT_DELETE_IDS_":"","formInfo":{"GUID":"","STATE":"","BACKTITLE":"'+this.title+'",'+
            // '"BACKMODULE":"'+this.backModule[0]+'","IMPORTANT":"'+this.chooseType[0]+'","BACKCONT":"'+this.content+'","PICTURE":'+
            // '"'+this.fieldToken+'","IDEA":"'+this.advice+'","INPUTUSERNAME":"'+this.name+'","PHONENUM":"'+this.phone+'",'+
            // '"DEPTNAME":"'+this.dept+'","NOTIFYCHECK":"SMS","NOTIFYMETHOD":"0,1,0","INPUTDATE":"'+this.inputDate+'","HANDLERFULLNAME":"'+this.person+'","HANDLERNAME":"'+this.personName + '",' +
            // '"FEEDBACKFULLNAME":"'+this.FEEDBACKFULLNAME+'","FEEDBACKNAME":"'+this.FEEDBACKNAME+'","PRINCIPALFULLNAME":"'+this.PRINCIPALFULLNAME + '",' +
            // '"PRINCIPALNAME":"'+ this.PRINCIPALNAME + '","ISSIGN":"'+this.ISSIGN+'","SIGNFULLNAME":"","SIGNNAME":"","ENDDATE":""}}'

            var params = {
                "_method":"formService.saveFormData",
                "requestEventData":
                    {"eventType":"formSubmitEvent",
                    "formType":1,
                    "bizObjId":"PMBASE_USERBACK2",
                    "formId":"PMBASE_USERBACK2_add",
                    "buttonId":"HandleCommand_1"},
                "flowParam":{
                    "defKey":"PMBASE_USERBACK2",
                    "nodeId":"UserTask_1",
                    "userCommandType":"startandsubmit",
                    "userCommandId":"HandleCommand_1",
                    "isAdmin":"false","taskComment":"",
                    "extParam":{}},
                    "_OBJ_NAME_":"PMBASE_USERBACK2",
                    "_FORM_ID_":"PMBASE_USERBACK2_add",
                    "useType":"add",
                    "pageToken":this.pageToken,
                "formData":{
                    "objName":"PMBASE_USERBACK2",
                    "pks":["GUID"],
                    "data":[{"rowData":
                            [{"DataTarget":"GUID","Value":"","OriginalValue":null,"PK":true,"DataType":"String"},
                            {"DataTarget":"STATE","Value":"","OriginalValue":null,"PK":false,"DataType":"String"},
                            {"DataTarget":"BACKTITLE","Value":this.title,"OriginalValue":null,"PK":false,"DataType":"String"},
                            {"DataTarget":"BACKMODULE","Value":this.backModule[0],"OriginalValue":null,"PK":false,"DataType":"String"},
                            {"DataTarget":"IMPORTANT","Value":this.chooseType[0],"OriginalValue":null,"PK":false,"DataType":"String"},
                            {"DataTarget":"BACKCONT","Value":this.content,"OriginalValue":null,"PK":false,"DataType":"String"},
                            {"DataTarget":"PICTURE","Value":this.fieldToken,"OriginalValue":null,"PK":false,"DataType":"Store.ecidiDoc"},
                            {"DataTarget":"IDEA","Value":this.advice,"OriginalValue":null,"PK":false,"DataType":"String"},
                            {"DataTarget":"INPUTUSERNAME","Value":this.name,"OriginalValue":null,"PK":false,"DataType":"String"},
                            {"DataTarget":"PHONENUM","Value":this.phone,"OriginalValue":null,"PK":false,"DataType":"String"},
                            {"DataTarget":"DEPTNAME","Value":this.dept,"OriginalValue":null,"PK":false,"DataType":"String"},
                            {"DataTarget":"NOTIFYCHECK","Value":"SMS","OriginalValue":null,"PK":false,"DataType":"String"},
                            {"DataTarget":"NOTIFYMETHOD","Value":"0,1,0","OriginalValue":null,"PK":false,"DataType":"String"},
                            {"DataTarget":"FEEDBACKFULLNAME","Value":this.FEEDBACKFULLNAME,"OriginalValue":null,"PK":false,"DataType":"String"},
                            {"DataTarget":"FEEDBACKNAME","Value":this.FEEDBACKNAME,"OriginalValue":null,"PK":false,"DataType":"String"},
                            {"DataTarget":"PRINCIPALFULLNAME","Value":this.PRINCIPALFULLNAME,"OriginalValue":null,"PK":false,"DataType":"String"},
                            {"DataTarget":"PRINCIPALNAME","Value":this.PRINCIPALNAME,"OriginalValue":null,"PK":false,"DataType":"String"},
                            {"DataTarget":"ISSIGN","Value":"否","OriginalValue":null,"PK":false,"DataType":"String"},
                            {"DataTarget":"SIGNFULLNAME","Value":"","OriginalValue":null,"PK":false,"DataType":"String"},
                            {"DataTarget":"SIGNNAME","Value":"","OriginalValue":null,"PK":false,"DataType":"String"},
                            {"DataTarget":"HANDLERFULLNAME","Value":this.person,"OriginalValue":null,"PK":false,"DataType":"String"},
                            {"DataTarget":"HANDLERNAME","Value":this.personName,"OriginalValue":null,"PK":false,"DataType":"String"},
                            {"DataTarget":"ENDDATE","Value":"","OriginalValue":null,"PK":false,"DataType":"TimeStamp"}],
                            "children":[]}]},
                    "_ATTACHMENT_DELETE_IDS_":"",
                    "formInfo":{
                        "GUID":"",
                        "STATE":"",
                        "BACKTITLE":this.title,
                        "BACKMODULE":this.backModule[0],
                        "IMPORTANT":this.chooseType[0],
                        "BACKCONT":this.content,
                        "PICTURE":this.fieldToken,
                        "IDEA":this.advice,
                        "INPUTUSERNAME":this.name,
                        "PHONENUM":this.phone,
                        "DEPTNAME":this.dept,
                        "NOTIFYCHECK":"SMS",
                        "NOTIFYMETHOD":"0,1,0",
                        "FEEDBACKFULLNAME":this.FEEDBACKFULLNAME,
                        "FEEDBACKNAME":this.FEEDBACKNAME,
                        "PRINCIPALFULLNAME":this.PRINCIPALFULLNAME,
                        "PRINCIPALNAME":this.PRINCIPALNAME,
                        "ISSIGN":"否",
                        "SIGNFULLNAME":"",
                        "SIGNNAME":"",
                        "HANDLERFULLNAME":this.person,
                        "HANDLERNAME":this.personName,
                        "ENDDATE":""}}

            let json = {
                FixJSON: JSON.stringify(params),
            }
            this.$ajax({
                url : this.COMMON_URL, //+'?_objName=undefined&_useType=add&_defKey=PMBASE_USERBACK2&_treeNodeId=&_treeNodeName=undefined',
                method : 'post',
                // data : this.signMD5({
                //     FixJSON : params
                // })
                data : json
            }).then(res=>{
                console.log(res)
                this.toastValue=true
                this.$router.push({
                    path:'/userBack',
                    name:'userBack',
                })
            }).catch((error)=>{
                alert(error)
            })
            
        },
        save(){
            if(this.chooseType.length==0){
                this.chooseType = ['']
            }
            if(this.backModule.length==0){
                this.backModule = ['']
            }
            // var params = '{"_method":"formService.saveFormData",'+
            // '"requestEventData":{"eventType":"formSubmitEvent","formType":1,"bizObjId":"PMBASE_USERBACK2","'+
            // 'formId":"PMBASE_USERBACK2_add","buttonId":"HandleCommand_3"},"flowParam":{"defKey":"PMBASE_USERBACK2",'+
            // '"nodeId":"UserTask_1","userCommandType":"saveTaskDraft","userCommandId":"HandleCommand_3","isAdmin":"false",'+
            // '"extParam":{}},"_OBJ_NAME_":"PMBASE_USERBACK2","_FORM_ID_":"PMBASE_USERBACK2_add","useType":"add","pageToken":'+
            // '"'+this.pageToken+'","formData":{"objName":"PMBASE_USERBACK2","pks":["GUID"],"data":[{"rowData":'+
            // '[{"DataTarget":"GUID","Value":"","OriginalValue":null,"PK":true,"DataType":"String"},{"DataTarget":"STATE","Value":"",'+
            // '"OriginalValue":null,"PK":false,"DataType":"String"},'+
            // '{"DataTarget":"BACKTITLE","Value":"'+this.title+'","OriginalValue":null,"PK":false,"DataType":"String"},'+
            // '{"DataTarget":"BACKMODULE","Value":"'+this.backModule[0]+'","OriginalValue":null,"PK":false,"DataType":"String"},'+
            // '{"DataTarget":"IMPORTANT","Value":"'+this.chooseType[0]+'","OriginalValue":null,"PK":false,"DataType":"String"},'+
            // '{"DataTarget":"BACKCONT","Value":"'+this.content+'","OriginalValue":null,"PK":false,"DataType":"String"},'+
            // '{"DataTarget":"PICTURE","Value":"'+this.fieldToken+'","OriginalValue":null,"PK":false,"DataType":"Store.ecidiDoc"},'+
            // '{"DataTarget":"IDEA","Value":"'+this.advice+'","OriginalValue":null,"PK":false,"DataType":"String"},'+
            // '{"DataTarget":"INPUTUSERNAME","Value":"'+this.name+'","OriginalValue":null,"PK":false,"DataType":"String"},'+
            // '{"DataTarget":"PHONENUM","Value":"'+this.phone+'","OriginalValue":null,"PK":false,"DataType":"String"},'+
            // '{"DataTarget":"DEPTNAME","Value":"'+this.dept+'","OriginalValue":null,"PK":false,"DataType":"String"},'+
            // '{"DataTarget":"INPUTDATE","Value":" '+this.inputDate+'","OriginalValue":null,"PK":false,"DataType":"TimeStamp"},'+
            // '{"DataTarget":"HANDLERFULLNAME","Value":"'+this.person+'","OriginalValue":null,"PK":false,"DataType":"String"},'+
            // '{"DataTarget":"HANDLERNAME","Value":"'+this.personName+'","OriginalValue":null,"PK":false,"DataType":"String"}],'+
            // '"children":[]}]},"_ATTACHMENT_DELETE_IDS_":"","formInfo":{"GUID":"","STATE":"","BACKTITLE":"'+this.title+'",'+
            // '"BACKMODULE":"'+this.backModule[0]+'","IMPORTANT":"'+this.chooseType[0]+'","BACKCONT":"'+this.content+'","PICTURE":'+
            // '"'+this.fieldToken+'","IDEA":"'+this.advice+'","INPUTUSERNAME":"'+this.name+'","PHONENUM":"'+this.phone+'",'+
            // '"DEPTNAME":"'+this.dept+'","INPUTDATE":"'+this.inputDate+'","HANDLERFULLNAME":"'+this.person+'","HANDLERNAME":"'+this.personName+'"}}'

            var params = {
                "_method":"formService.saveFormData",
                "requestEventData":
                    {"eventType":"formSubmitEvent",
                    "formType":1,
                    "bizObjId":"PMBASE_USERBACK2",
                    "formId":"PMBASE_USERBACK2_add",
                    "buttonId":"HandleCommand_1"},
                "flowParam":{
                    "defKey":"PMBASE_USERBACK2",
                    "nodeId":"UserTask_1",
                    "userCommandType":"startandsubmit",
                    "userCommandId":"HandleCommand_1",
                    "isAdmin":"false","taskComment":"",
                    "extParam":{}},
                    "_OBJ_NAME_":"PMBASE_USERBACK2",
                    "_FORM_ID_":"PMBASE_USERBACK2_add",
                    "useType":"add",
                    "pageToken":this.pageToken,
                "formData":{
                    "objName":"PMBASE_USERBACK2",
                    "pks":["GUID"],
                    "data":[{"rowData":
                            [{"DataTarget":"GUID","Value":"","OriginalValue":null,"PK":true,"DataType":"String"},
                            {"DataTarget":"STATE","Value":"","OriginalValue":null,"PK":false,"DataType":"String"},
                            {"DataTarget":"BACKTITLE","Value":this.title,"OriginalValue":null,"PK":false,"DataType":"String"},
                            {"DataTarget":"BACKMODULE","Value":this.backModule[0],"OriginalValue":null,"PK":false,"DataType":"String"},
                            {"DataTarget":"IMPORTANT","Value":this.chooseType[0],"OriginalValue":null,"PK":false,"DataType":"String"},
                            {"DataTarget":"BACKCONT","Value":this.content,"OriginalValue":null,"PK":false,"DataType":"String"},
                            {"DataTarget":"PICTURE","Value":this.fieldToken,"OriginalValue":null,"PK":false,"DataType":"Store.ecidiDoc"},
                            {"DataTarget":"IDEA","Value":this.advice,"OriginalValue":null,"PK":false,"DataType":"String"},
                            {"DataTarget":"INPUTUSERNAME","Value":this.name,"OriginalValue":null,"PK":false,"DataType":"String"},
                            {"DataTarget":"PHONENUM","Value":this.phone,"OriginalValue":null,"PK":false,"DataType":"String"},
                            {"DataTarget":"DEPTNAME","Value":this.dept,"OriginalValue":null,"PK":false,"DataType":"String"},
                            {"DataTarget":"NOTIFYCHECK","Value":"SMS","OriginalValue":null,"PK":false,"DataType":"String"},
                            {"DataTarget":"NOTIFYMETHOD","Value":"0,1,0","OriginalValue":null,"PK":false,"DataType":"String"},
                            {"DataTarget":"FEEDBACKFULLNAME","Value":this.FEEDBACKFULLNAME,"OriginalValue":null,"PK":false,"DataType":"String"},
                            {"DataTarget":"FEEDBACKNAME","Value":this.FEEDBACKNAME,"OriginalValue":null,"PK":false,"DataType":"String"},
                            {"DataTarget":"PRINCIPALFULLNAME","Value":this.PRINCIPALFULLNAME,"OriginalValue":null,"PK":false,"DataType":"String"},
                            {"DataTarget":"PRINCIPALNAME","Value":this.PRINCIPALNAME,"OriginalValue":null,"PK":false,"DataType":"String"},
                            {"DataTarget":"ISSIGN","Value":"否","OriginalValue":null,"PK":false,"DataType":"String"},
                            {"DataTarget":"SIGNFULLNAME","Value":"","OriginalValue":null,"PK":false,"DataType":"String"},
                            {"DataTarget":"SIGNNAME","Value":"","OriginalValue":null,"PK":false,"DataType":"String"},
                            {"DataTarget":"HANDLERFULLNAME","Value":this.person,"OriginalValue":null,"PK":false,"DataType":"String"},
                            {"DataTarget":"HANDLERNAME","Value":this.personName,"OriginalValue":null,"PK":false,"DataType":"String"},
                            {"DataTarget":"ENDDATE","Value":"","OriginalValue":null,"PK":false,"DataType":"TimeStamp"}],
                            "children":[]}]},
                    "_ATTACHMENT_DELETE_IDS_":"",
                    "formInfo":{
                        "GUID":"",
                        "STATE":"",
                        "BACKTITLE":this.title,
                        "BACKMODULE":this.backModule[0],
                        "IMPORTANT":this.chooseType[0],
                        "BACKCONT":this.content,
                        "PICTURE":this.fieldToken,
                        "IDEA":this.advice,
                        "INPUTUSERNAME":this.name,
                        "PHONENUM":this.phone,
                        "DEPTNAME":this.dept,
                        "NOTIFYCHECK":"SMS",
                        "NOTIFYMETHOD":"0,1,0",
                        "FEEDBACKFULLNAME":this.FEEDBACKFULLNAME,
                        "FEEDBACKNAME":this.FEEDBACKNAME,
                        "PRINCIPALFULLNAME":this.PRINCIPALFULLNAME,
                        "PRINCIPALNAME":this.PRINCIPALNAME,
                        "ISSIGN":"否",
                        "SIGNFULLNAME":"",
                        "SIGNNAME":"",
                        "HANDLERFULLNAME":this.person,
                        "HANDLERNAME":this.personName,
                        "ENDDATE":""}}

            let json = {
                FixJSON: JSON.stringify(params),
            }

            this.$ajax({
                url : this.COMMON_URL, //+'?_objName=undefined&_useType=add&_defKey=PMBASE_USERBACK2&_treeNodeId=&_treeNodeName=undefined',
                method : 'post',
                data : json
            }).then(res=>{
                console.log(res)
                this.toastValue=true
                this.$router.push({
                    path:'/userBack',
                    name:'userBack',
                })
            })
        },
        getBackModulesAndType(){
            // var params = '{"_method":"component.getBatchDatas","_param":{"controls":{"BACKMODULE":{"orgConfig":{"Filter":"TYPE_ID=\'PMBASE_USERBACK_nodeType\'","Fields":"CODE_ID,CODE_NAME","BizObj":"FIX_SYS_CODE","Service":"selectMore_defauld","componentType":"ECIDIHTMLSelect"},"dataConfig":{"Method":"component.getListData","Param":{"bizObj":"FIX_SYS_CODE","service":"selectMore_defauld","fields":"CODE_ID,CODE_NAME","filter":"TYPE_ID=\'PMBASE_USERBACK_nodeType\'","currentPageIndex":1,"pageSize":999999,"orderList":[],"QueryFormData":""},"componentType":"ECIDIHTMLSelect"},"storeType":"Data"},'+
            // '"IMPORTANT":{"orgConfig":{"Filter":"TYPE_ID=\'PMBASE_USERBACK2.IMPORTANT\'","Fields":"CODE_ID,CODE_NAME","OrderList":[{"order":"asc","field":"CODE_ORDER"}],"BizObj":"FIX_SYS_CODE","Service":"selectMore_defauld","componentType":"ECIDIHTMLSelect"},"dataConfig":{"Method":"component.getListData","Param":{"bizObj":"FIX_SYS_CODE","service":"selectMore_defauld","fields":"CODE_ID,CODE_NAME","filter":"TYPE_ID=\'PMBASE_USERBACK2.IMPORTANT\'","currentPageIndex":1,"pageSize":999999,"orderList":[{"order":"asc","field":"CODE_ORDER"}],"QueryFormData":""},"componentType":"ECIDIHTMLSelect"},"storeType":"Data"}}}}'
            var params = {
                _method:"component.getBatchDatas",
                _param:{
                    controls:{
                        BACKMODULE:{
                           orgConfig:{
                               Filter:{},
                               Fields:"CODE_ID,CODE_NAME,CODE_ORDER",
                               BizObj:"PMHSE_THIRDDIRECTION_DETAIL",
                               Service:"sys_getFeedbackModule",
                               componentType:"ECIDIHTMLSelect"
                           },
                           dataConfig:{
                               Method:"component.getListData",
                               Param:{
                                   bizObj:"PMHSE_THIRDDIRECTION_DETAIL",
                                   service:"sys_getFeedbackModule",
                                   fields:"CODE_ID,CODE_NAME,CODE_ORDER",
                                   filter:{},
                                   currentPageIndex:1,
                                   pageSize:99999,
                                   orderList:[{
                                     order:"desc",
                                     field:"code_order"
                                   }
                                    

                                   ],
                                   QueryFormData:""
                               },
                               componentType:"ECIDIHTMLSelect"
                            },
                            storeType:"Data"                            
                        },
                       IMPORTANT:{
                           orgConfig:{
                              Filter:{},
                               Fields:"CODE_ID,CODE_NAME,CODE_ORDER",
                              OrderList:[{
                                  order:"asc",
                                  field: "CODE_ORDER"
                              }],
                              BizObj:"PMHSE_THIRDDIRECTION_DETAIL",
                              Service: "sys_getProblemCategory",
                              componentType:"ECIDIHTMLSelect"
                             },
                           dataConfig:{
                               Method:"component.getListData",
                                Param:{
                                bizObj:"PMHSE_THIRDDIRECTION_DETAIL",
                                service:"sys_getProblemCategory",
                                fields:"CODE_ID,CODE_NAME,CODE_ORDER",
                                filter:{},
                                currentPageIndex:1,
                                pageSize:999999,
                                orderList:[{
                                    order:"asc",
                                    field:"CODE_ORDER"
                                }],
                                QueryFormData:""
                               },
                               componentType:"ECIDIHTMLSelect"
                            },
                           storeType:"Data"
                        }
                    },
                }
            }
            
            this.$ajax({
                url : this.COMMON_URL, //+ '?_objName=undefined&_useType=add&_defKey=PMBASE_USERBACK2&_treeNodeId=&_treeNodeName=undefined',
                method : 'post',
                // data : this.signMD5({
                //     FixJSON : params
                // })
                data : {
                    FixJSON :JSON.stringify(params) 
                }
            }).then(res=>{
                console.log(res)
                this.temp = res.data.datas.BACKMODULE;
                for(var i=0;i<this.temp.length;i++){
                    this.modules.push(this.temp[i].CODE_NAME)
                }
                var temp1 = res.data.datas.IMPORTANT
                for(var i=0; i < temp1.length;i++){
                    this.type.push(temp1[i].CODE_NAME)
                }
                // var typeList = res.data.datas.IMPORTANT;
                // for(var i=0;i<typeList.length;i++){
                //     this.type.push(typeList[i].CODE_NAME)
                // }
                // this.type=[this.type];
                this.modules=[this.modules];
                this.type = [this.type];
            })
        },
         saveErr(){
            this.toastValueErr=false;
        }
    }

}
</script>

<style scoped>
/* .transition-view .vux-header /deep/ .vux-header-title{
    color: #000000;
}
.transition-view /deep/ .vux-header .vux-header-left .left-arrow:before{
    border-color: #cccccc;
} */
.transition-view /deep/ .weui-cells__title{
        color: #000000;
        padding-left: 20px;
}
.userBack-button_save{
      width: 40%;
      height: 40px;
      background-color: #ffffff;
      border-radius: 2pt;
      border: 1pt solid #4D86FF;
      margin-top: 20pt;
      color: #4D86FF;
      font-size: 13px;
      margin-left: 15px;
  }
  .userBack-button_submit{
      width: 40%;
      height: 40px;
      background-color: #4D86FF;
      border-radius: 2pt;
      border: 1pt solid #4D86FF;
      margin-top: 20pt;
      color: #FFFFFF;
      font-size: 13px;
      margin-left: auto;
      margin-right: 5%;
  }
  .part1{
      padding: 10px;
      border-bottom: none;
  }
  .transition-view /deep/ .show{
      padding: 0;
  }
 .transition-view /deep/.weui-cells:before{
      border-top:none;
  }
.transition-view /deep/ .weui-cells:after{
        border-bottom:none
    }
    .transition-view /deep/ .weui-cell{
        padding:20px 15px;
    }
    .transition-view /deep/ .my-cell{
        font-size: 14px;
    }
  .sup{
  width: 100%;
  height: 10px;
  border-radius: 0;
  background-color: #F5F5F5;
}
.top-border{
  border-top: 1px solid #f5f5f5
}
  </style>